Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Function |is_negative

std/ops/num::|is_negative


Usage

|is_negative<N>(value)

Generics

◻ N: Signed

Parameters

↳ value: N

Return

bool


Tells if a value is negative.

Returns true for strictly negative integers, and false for 0 and positive ones.
ℹ️ For floating types (f32 and f64), NaN values gives false, -INFINITY and -0.0 gives true.